package com.Venue.service.impl;

import com.Venue.entity.Venue;
import com.Venue.mapper.VenueMapper;
import com.Venue.service.VenueService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 场地信息 业务逻辑实现类
 */
@Service
@Transactional
public class VenueServiceImpl implements VenueService {

    @Resource
    public VenueMapper venueMapper;

    /**
     * 添加场地信息
     * @param venue
     * @return
     */
    @Override
    public boolean doAddVenueInfo(Venue venue) {
        if (venueMapper.doGetVenueInfo(venue) == null) {
            return venueMapper.doAddVenueInfo(venue) != 0;
        }
        return false;
    }

    /**
     * 修改场地信息
     * @param venue
     * @return
     */
    @Override
    public boolean doModifyVenueInfo(Venue venue) {
        return venueMapper.doModifyVenueInfo(venue) != 0;
    }

    /**
     * 删除场地信息
     * @param venue
     * @return
     */
    @Override
    public boolean doDeleteVenueInfo(Venue venue) {
        return venueMapper.doDeleteVenueInfo(venue) != 0;
    }

    /**
     * 获取场地信息
     * @param venue
     * @return
     */
    @Override
    public Venue doGetVenueInfo(Venue venue) {
        return venueMapper.doGetVenueInfo(venue);
    }

    /**
     * 获取场地列表
     * @return
     */
    @Override
    public List<Venue> doGetVenueInfoList() {
        return venueMapper.doGetVenueInfoList();
    }

    /**
     * 查询场地列表
     * @param venue
     * @return
     */
    @Override
    public List<Venue> doQueryVenueInfoList(Venue venue) {
        return venueMapper.doQueryVenueInfoList(venue);
    }
}